
import { _decorator, Component, Node, LabelComponent } from 'cc';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = PlayerBox
 * DateTime = Wed Feb 09 2022 12:40:26 GMT+0800 (中国标准时间)
 * Author = awi1299
 * FileBasename = PlayerBox.ts
 * FileBasenameNoExtension = PlayerBox
 * URL = db://assets/script/PlayerBox/PlayerBox.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */
 
@ccclass('PlayerBox')
export class PlayerBox extends Component {
    @property(LabelComponent)
    labelName:LabelComponent

    @property(LabelComponent)
    labelConnect:LabelComponent

    start () {
        
    }

    displayName(){
        this.labelName.string = this.node.name
    }

    changeConnect(isConnect:boolean){
        if(isConnect)this.labelConnect.string = ''
        else this.labelConnect.string = '离线'
    }
}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.4/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.4/manual/zh/scripting/decorator.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.4/manual/zh/scripting/life-cycle-callbacks.html
 */
